//
//  Created by  fred on 2017/1/12.
//  Copyright © 2016年 Alibaba. All rights reserved.
//

package com.zmzncs.lmtc.common.interactive.miwang;

import com.alibaba.cloudapi.sdk.client.ApacheHttpClient;
import com.alibaba.cloudapi.sdk.enums.HttpMethod;
import com.alibaba.cloudapi.sdk.enums.ParamPosition;
import com.alibaba.cloudapi.sdk.enums.Scheme;
import com.alibaba.cloudapi.sdk.model.ApiCallback;
import com.alibaba.cloudapi.sdk.model.ApiRequest;
import com.alibaba.cloudapi.sdk.model.ApiResponse;
import com.alibaba.cloudapi.sdk.model.HttpClientBuilderParams;


public class HttpApiClientMWpark extends ApacheHttpClient{
    public final static String HOST = "api.mwpark.cn";
    static HttpApiClientMWpark instance = new HttpApiClientMWpark();
    public static HttpApiClientMWpark getInstance(){return instance;}

    public void init(HttpClientBuilderParams httpClientBuilderParams){
        httpClientBuilderParams.setScheme(Scheme.HTTP);
        httpClientBuilderParams.setHost(HOST);
        super.init(httpClientBuilderParams);
    }

    public void mwpark_openapi_roadWayControlGate(String appId , String partnerCode , String roadWayCode , Integer operateType , ApiCallback callback) {
        String path = "/gate/control/roadWayControlGate";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("roadWayCode" , roadWayCode , ParamPosition.BODY , true);
        request.addParam("operateType" , String.valueOf(operateType) , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_openapi_roadWayControlGateSyncMode(String appId , String partnerCode , String roadWayCode , Integer operateType) {
        String path = "/gate/control/roadWayControlGate";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("roadWayCode" , roadWayCode , ParamPosition.BODY , true);
        request.addParam("operateType" , String.valueOf(operateType) , ParamPosition.BODY , true);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_queryEntranceAndRoadWay(String appId , String partnerCode , ApiCallback callback) {
        String path = "/gate/lot/queryEntranceAndRoadWay";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_queryEntranceAndRoadWaySyncMode(String appId , String partnerCode) {
        String path = "/gate/lot/queryEntranceAndRoadWay";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_getParkingLotByCode(String appId , String partnerCode , ApiCallback callback) {
        String path = "/gate/lot/getParkingLotByCode";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_getParkingLotByCodeSyncMode(String appId , String partnerCode) {
        String path = "/gate/lot/getParkingLotByCode";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_incrementFixedCarSync(String appId , String partnerCode , ApiCallback callback) {
        String path = "/gate/lot/incrementFixedCarSync";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_incrementFixedCarSyncSyncMode(String appId , String partnerCode) {
        String path = "/gate/lot/incrementFixedCarSync";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_deleteFixedCar_batch(String appId , String partnerCode , String fixedCarCodeList , ApiCallback callback) {
        String path = "/gate/lot/deleteFixedCar_batch";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("fixedCarCodeList" , fixedCarCodeList , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_deleteFixedCar_batchSyncMode(String appId , String partnerCode , String fixedCarCodeList) {
        String path = "/gate/lot/deleteFixedCar_batch";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("fixedCarCodeList" , fixedCarCodeList , ParamPosition.BODY , true);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_updateFixedCar(String appId , String partnerCode , String fixedCarCode , String invalidDate , String validDate , String userName , String parkingSpaceNumber , String mobileNumber , String remark , String fixedCarRuleCode , Double amount , Integer parkingSpaceCount , String fixedCarPlateList , ApiCallback callback) {
        String path = "/gate/lot/updateFixedCar";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("fixedCarCode" , fixedCarCode , ParamPosition.BODY , true);
        request.addParam("invalidDate" , invalidDate , ParamPosition.BODY , false);
        request.addParam("validDate" , validDate , ParamPosition.BODY , false);
        request.addParam("userName" , userName , ParamPosition.BODY , false);
        request.addParam("parkingSpaceNumber" , parkingSpaceNumber , ParamPosition.BODY , false);
        request.addParam("mobileNumber" , mobileNumber , ParamPosition.BODY , false);
        request.addParam("remark" , remark , ParamPosition.BODY , false);
        request.addParam("fixedCarRuleCode" , fixedCarRuleCode , ParamPosition.BODY , false);
        request.addParam("amount" , String.valueOf(amount) , ParamPosition.BODY , false);
        request.addParam("parkingSpaceCount" , String.valueOf(parkingSpaceCount) , ParamPosition.BODY , false);
        request.addParam("fixedCarPlateList" , fixedCarPlateList , ParamPosition.BODY , false);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_updateFixedCarSyncMode(String appId , String partnerCode , String fixedCarCode , String invalidDate , String validDate , String userName , String parkingSpaceNumber , String mobileNumber , String remark , String fixedCarRuleCode , Double amount , Integer parkingSpaceCount , String fixedCarPlateList) {
        String path = "/gate/lot/updateFixedCar";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("fixedCarCode" , fixedCarCode , ParamPosition.BODY , true);
        request.addParam("invalidDate" , invalidDate , ParamPosition.BODY , false);
        request.addParam("validDate" , validDate , ParamPosition.BODY , false);
        request.addParam("userName" , userName , ParamPosition.BODY , false);
        request.addParam("parkingSpaceNumber" , parkingSpaceNumber , ParamPosition.BODY , false);
        request.addParam("mobileNumber" , mobileNumber , ParamPosition.BODY , false);
        request.addParam("remark" , remark , ParamPosition.BODY , false);
        request.addParam("fixedCarRuleCode" , fixedCarRuleCode , ParamPosition.BODY , false);
        request.addParam("amount" , String.valueOf(amount) , ParamPosition.BODY , false);
        request.addParam("parkingSpaceCount" , String.valueOf(parkingSpaceCount) , ParamPosition.BODY , false);
        request.addParam("fixedCarPlateList" , fixedCarPlateList , ParamPosition.BODY , false);



        return sendSyncRequest(request);
    }


    public void mwpark_sandbox_insertOrRenewFixedCar(String appId , String partnerCode , String invalidDate , String validDate , String userName , String parkingSpaceNumber , String mobileNumber , String remark , String operate , String fixedCarRuleCode , Double amount , Integer parkingSpaceCount , String fixedCarPlateList , String fixedCarCode , ApiCallback callback) {
        String path = "/gate/lot/insertOrRenewFixedCar";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("invalidDate" , invalidDate , ParamPosition.BODY , false);
        request.addParam("validDate" , validDate , ParamPosition.BODY , false);
        request.addParam("userName" , userName , ParamPosition.BODY , false);
        request.addParam("parkingSpaceNumber" , parkingSpaceNumber , ParamPosition.BODY , false);
        request.addParam("mobileNumber" , mobileNumber , ParamPosition.BODY , false);
        request.addParam("remark" , remark , ParamPosition.BODY , false);
        request.addParam("operate" , operate , ParamPosition.BODY , false);
        request.addParam("fixedCarRuleCode" , fixedCarRuleCode , ParamPosition.BODY , false);
        request.addParam("amount" , String.valueOf(amount) , ParamPosition.BODY , false);
        request.addParam("parkingSpaceCount" , String.valueOf(parkingSpaceCount) , ParamPosition.BODY , false);
        request.addParam("fixedCarPlateList" , fixedCarPlateList , ParamPosition.BODY , false);
        request.addParam("fixedCarCode" , fixedCarCode , ParamPosition.BODY , false);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_insertOrRenewFixedCarSyncMode(String appId , String partnerCode , String invalidDate , String validDate , String userName , String parkingSpaceNumber , String mobileNumber , String remark , String operate , String fixedCarRuleCode , Double amount , Integer parkingSpaceCount , String fixedCarPlateList , String fixedCarCode) {
        String path = "/gate/lot/insertOrRenewFixedCar";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("invalidDate" , invalidDate , ParamPosition.BODY , false);
        request.addParam("validDate" , validDate , ParamPosition.BODY , false);
        request.addParam("userName" , userName , ParamPosition.BODY , false);
        request.addParam("parkingSpaceNumber" , parkingSpaceNumber , ParamPosition.BODY , false);
        request.addParam("mobileNumber" , mobileNumber , ParamPosition.BODY , false);
        request.addParam("remark" , remark , ParamPosition.BODY , false);
        request.addParam("operate" , operate , ParamPosition.BODY , false);
        request.addParam("fixedCarRuleCode" , fixedCarRuleCode , ParamPosition.BODY , false);
        request.addParam("amount" , String.valueOf(amount) , ParamPosition.BODY , false);
        request.addParam("parkingSpaceCount" , String.valueOf(parkingSpaceCount) , ParamPosition.BODY , false);
        request.addParam("fixedCarPlateList" , fixedCarPlateList , ParamPosition.BODY , false);
        request.addParam("fixedCarCode" , fixedCarCode , ParamPosition.BODY , false);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_queryFixedCar(String appId , String partnerCode , String startDate , String endDate , String userName , String plateNumber , String parkingSpaceNumber , String mobileNumber , Integer pageSize , Integer pageNo , String remark , String fixedCarStatus , String fixedCarRuleCode , ApiCallback callback) {
        String path = "/gate/lot/queryFixedCar";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("startDate" , startDate , ParamPosition.BODY , false);
        request.addParam("endDate" , endDate , ParamPosition.BODY , false);
        request.addParam("userName" , userName , ParamPosition.BODY , false);
        request.addParam("plateNumber" , plateNumber , ParamPosition.BODY , false);
        request.addParam("parkingSpaceNumber" , parkingSpaceNumber , ParamPosition.BODY , false);
        request.addParam("mobileNumber" , mobileNumber , ParamPosition.BODY , false);
        request.addParam("pageSize" , String.valueOf(pageSize) , ParamPosition.BODY , false);
        request.addParam("pageNo" , String.valueOf(pageNo) , ParamPosition.BODY , false);
        request.addParam("remark" , remark , ParamPosition.BODY , false);
        request.addParam("fixedCarStatus" , fixedCarStatus , ParamPosition.BODY , false);
        request.addParam("fixedCarRuleCode" , fixedCarRuleCode , ParamPosition.BODY , false);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_queryFixedCarSyncMode(String appId , String partnerCode , String startDate , String endDate , String userName , String plateNumber , String parkingSpaceNumber , String mobileNumber , Integer pageSize , Integer pageNo , String remark , String fixedCarStatus , String fixedCarRuleCode) {
        String path = "/gate/lot/queryFixedCar";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("startDate" , startDate , ParamPosition.BODY , false);
        request.addParam("endDate" , endDate , ParamPosition.BODY , false);
        request.addParam("userName" , userName , ParamPosition.BODY , false);
        request.addParam("plateNumber" , plateNumber , ParamPosition.BODY , false);
        request.addParam("parkingSpaceNumber" , parkingSpaceNumber , ParamPosition.BODY , false);
        request.addParam("mobileNumber" , mobileNumber , ParamPosition.BODY , false);
        request.addParam("pageSize" , String.valueOf(pageSize) , ParamPosition.BODY , false);
        request.addParam("pageNo" , String.valueOf(pageNo) , ParamPosition.BODY , false);
        request.addParam("remark" , remark , ParamPosition.BODY , false);
        request.addParam("fixedCarStatus" , fixedCarStatus , ParamPosition.BODY , false);
        request.addParam("fixedCarRuleCode" , fixedCarRuleCode , ParamPosition.BODY , false);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_queryFixedCarRule(String appId , String partnerCode , ApiCallback callback) {
        String path = "/gate/lot/queryFixedCarRule";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_queryFixedCarRuleSyncMode(String appId , String partnerCode) {
        String path = "/gate/lot/queryFixedCarRule";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_rechargeNotify(String appId , String partnerCode , String billCode , Double payAmount , String outTradeCode , ApiCallback callback) {
        String path = "/gate/order/rechargeNotify";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("billCode" , billCode , ParamPosition.BODY , true);
        request.addParam("payAmount" , String.valueOf(payAmount) , ParamPosition.BODY , true);
        request.addParam("outTradeCode" , outTradeCode , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_rechargeNotifySyncMode(String appId , String partnerCode , String billCode , Double payAmount , String outTradeCode) {
        String path = "/gate/order/rechargeNotify";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("billCode" , billCode , ParamPosition.BODY , true);
        request.addParam("payAmount" , String.valueOf(payAmount) , ParamPosition.BODY , true);
        request.addParam("outTradeCode" , outTradeCode , ParamPosition.BODY , true);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_getCurrentChargeBill(String appId , String partnerCode , String roadWayCode , String plateNumber , String temporaryCode , ApiCallback callback) {
        String path = "/gate/lot/getCurrentChargeBill";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("roadWayCode" , roadWayCode , ParamPosition.BODY , false);
        request.addParam("plateNumber" , plateNumber , ParamPosition.BODY , false);
        request.addParam("temporaryCode" , temporaryCode , ParamPosition.BODY , false);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_getCurrentChargeBillSyncMode(String appId , String partnerCode , String roadWayCode , String plateNumber , String temporaryCode) {
        String path = "/gate/lot/getCurrentChargeBill";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("roadWayCode" , roadWayCode , ParamPosition.BODY , false);
        request.addParam("plateNumber" , plateNumber , ParamPosition.BODY , false);
        request.addParam("temporaryCode" , temporaryCode , ParamPosition.BODY , false);



        return sendSyncRequest(request);
    }
    public void mwpark_sandbox_scanInRoadWayCode(String appId , String partnerCode , String roadWayCode , ApiCallback callback) {
        String path = "/gate/lot/scanInRoadWayCode";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("roadWayCode" , roadWayCode , ParamPosition.BODY , true);



        sendAsyncRequest(request , callback);
    }

    public ApiResponse mwpark_sandbox_scanInRoadWayCodeSyncMode(String appId , String partnerCode , String roadWayCode) {
        String path = "/gate/lot/scanInRoadWayCode";
        ApiRequest request = new ApiRequest(HttpMethod.POST_FORM , path);
        request.addParam("appId" , appId , ParamPosition.BODY , true);
        request.addParam("partnerCode" , partnerCode , ParamPosition.BODY , true);
        request.addParam("roadWayCode" , roadWayCode , ParamPosition.BODY , true);

        return sendSyncRequest(request);
    }
}